package com.esheeper.mainserver.pojo;

import lombok.Data;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.List;

@Data
@Document("Post")
public class Post {
    String id;
    String type;
    List<String> tags;
    String content;

    String authorId;

    int collectNumber;
    int coinNumber;
    int browserNumber;
    int like;

    List<Media> medias;

    int getUnixSecondTimeStamp(){
        if(id == null){
            return -1;
        }
        String substring = id.substring(0, 8);
        return Integer.parseInt(substring,16);
    }
}
